package net.xmat.webtest.dao.impl;

import java.util.List;

import net.xmat.webtest.beans.Publisher;
import net.xmat.webtest.dao.IPublisherDao;
import net.xmat.webtest.utils.HibernateOperations;

import org.hibernate.Session;

public class PublisherDao implements IPublisherDao {

	public List<Publisher> list(String name)  {
		return HibernateOperations.list(Publisher.class, name);
	}

	public void save(final Publisher a) {
		new HibernateTransaction().execute(
				new IHibernateWork() {
					public void doInTransaction(Session session) {
						session.saveOrUpdate(a);
					}
				}
			);
	}
}
